#!/bin/bash
HOME=/opt/fonsview/3RD/zabbix
auth_total=`mysql ossdb  -e "select count(*) from servicelog where createTime >=  NOW() - interval 24 hour;"|sed 1d`
auth_success=`mysql ossdb  -e "select count(*) from servicelog where resultCode =  '0' and createTime >=  NOW() - interval 24 hour;"|sed 1d`
RESULT=$(awk "BEGIN {printf \"%.2f\",${auth_success}/${auth_total}}")
echo $RESULT